<?php
/*
	
*/
defined('BY_JYA') or exit('Access Denied');
global $_RQ,$_AR;

$_RQ['op']=$_RQ['op']?$_RQ['op']:'list';
$return=array();
$setting=$this->plugin_setting('basic');
$return['banner']=$setting['hdps'];
$return['setting']=$setting;
if($_RQ['op']=='list'){
	$params=array('uniacid'=>$_SESSION['uniacid']);
	if($_RQ['keyword']){
		$params['title like']='%'.trim($_RQ['keyword']).'%';
	}
	$pindex = max(1, intval($_RQ['page']));
	$psize = 30;
	$total='';
	$fields=array('id','mid','status','image','ewm','title','desc');
	$list=pdo_getslice('jy_ewm_list',$params,array($pindex,$psize),$total,$fields,'','createtime desc');
	foreach($list as &$item){
		$row['link']=custom_url($row['link'],true);	
	}
	$return['list']=$list;
	$return['sharedata']=array(
		'title'=>$setting['share_title'],
		'desc'=>$setting['share_desc'],
		'link'=>custom_url('jy_ewm/index/',true),
		'imgUrl'=>ATTACHMENT_URL.$setting['share_image'],
	);
	set_html('title',$setting['title']?:'首页');
	exi($return);
}